﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BGM_Project_Option.aspx.cs" Inherits="KPIS.GERP.GBMS.APP_UI.Form.BGM_Project_Option" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@ Register src="../Controls/Combo/SourceCombo.ascx" tagname="Source" tagprefix="uc5" %>
<%@ Register src="../Controls/Combo/ExpenseCombo.ascx" tagname="Expense" tagprefix="uc6" %>


<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <title><asp:Literal runat="Server" id="litTitle"/></title>
</head>
<body>
    <form id="form1" runat="server">
        <link rel="StyleSheet" href="../../Styles/StyleSheet.css" type="text/css" />
        
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>  
        
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None" >
        </telerik:RadAjaxLoadingPanel>
        
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="pnGridExpense">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="pnGridExpense" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="lbSumWeight" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <%--<telerik:AjaxSetting AjaxControlID="tvOption">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rptSample" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>--%>
            </AjaxSettings>
        </telerik:RadAjaxManager>    


        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">


            </script>
        </telerik:RadCodeBlock>
        <div id="divWeight" runat="server" class="defaultFont" style="padding: 20px">
            <table cellpadding="0" cellspacing="0" width="800px" style="font-weight: bold; padding-left: 15px;">
                <tr>
                    <td align="left" style="padding-top: 3px; padding-bottom: 3px;">
                        &nbsp;&nbsp;ชื่อ
                    </td>
                    <td width="120px" align="right" style="padding-top: 3px; padding-bottom: 3px;">
                        น้ำหนัก %
                    </td>
                    <td width="120px" align="right" style="padding-top: 3px; padding-bottom: 3px;">
                        จำนวนเงิน(บาท)
                    </td>
                </tr>
            </table>
            <asp:Panel ID="pnGridExpense" runat="server" Width="830px" Height="320px" ScrollBars="Auto">
                <table cellpadding="0" cellspacing="0" width="830px" class="defaultTable" >
                    <tr>
                        <td style="padding-left: 15px;">
                            <asp:Label ID="lbProjectID" runat="server" Visible="false"></asp:Label>
                            <asp:Label ID="lbOptionType" runat="server" Visible="false"></asp:Label>
                            <asp:Repeater ID="Repeater1" runat="server">
                                <HeaderTemplate>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:Panel ID="PanelItem" runat="server">
                                        <table width="100%" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td align="left" style="padding-top: 3px; padding-bottom: 3px;">
                                                    &nbsp;&nbsp;<%# Eval("bgm_option_name") %>
                                                </td>
                                                <td width="120px" align="right" style="padding-top: 3px; padding-bottom: 3px;">
                                                    <telerik:RadNumericTextBox ID="txtWeight" runat="server" Width="120px"
                                                        Text='<%# Eval("weight", "{0:n2}")%>' AutoPostBack="true"
                                                        OnTextChanged="txtWeight_TextChanged" />
                                                </td>
                                                <td width="120px" align="right" style="padding-top: 3px; padding-bottom: 3px;">
                                                    <asp:Label ID="lblAmount" runat="server" Width="120px" />
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:Panel>
                                    <table width="100%" cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td align="left" width="20px">
                                                <asp:Label ID="lblBgmOptionSeq" runat="server" Visible="false" Text='<%# Eval("bgm_option_seq") %>' />
                                                <asp:Label ID="lblChildCount" runat="server" Visible="false" Text='<%# Eval("child_count") %>' />
                                                <asp:Label ID="lblBgmProjOptSeq" runat="server" Visible="false" Text='<%# Eval("bgm_proj_opt_seq") %>' />
                                            </td>
                                            <td align="left">
                                                <asp:Panel ID="PanelSub" runat="server">
                                                </asp:Panel>
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                            </asp:Repeater>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <table>
                <tr>
                    <td>
                        <br />
                        <table width="800px">
                            <tr>
                                <td width="170px" style="font-weight: bold">
                                    จำนวนเงินรวมในโครงการ :
                                </td>
                                <td width="120px">
                                    <asp:Label ID="lblSumAmount" runat="server" ForeColor="Blue" Font-Bold="True" />
                                </td>
                                <td width="30px">
                                    บาท
                                </td>
                                <td width="280px" align="right" style="font-weight: bold">
                                    รวมน้ำหนัก :
                                </td>
                                <td align="right">
                                    <asp:Label ID="lbSumWeight" runat="server" ForeColor="Blue" 
                                        Font-Bold="True" Text="0"></asp:Label>
                                </td>
                                <td width="20px">
                                    %
                                </td>
                            </tr>
                        </table>
                     </td>
                </tr>
            </table>
            <table width="800px">
                <tr valign="top">
                    <td align="center" style="padding-top: 15px; border-top-style: double; border-top-width: 1px; border-top-color: #000000;">
                        <asp:Button ID="btnSaveAddNewOpt" runat="server" Text="บันทึกข้อมูล" OnClick="btnSaveAddNewOpt_Click" />
                    </td>
                </tr>
            </table>            
        </div>

        <div id="divTreeView" runat="server" class="defaultFont" style="padding: 20px">
            <div style="width:50%; float:left;">
            <telerik:RadTreeView ID="tvOption" runat="server" CheckBoxes="True" MultipleSelect="false" SelectMethod="none"
                DataFieldID="bgm_option_seq" DataFieldParentID="upper_bgm_option_seq"
                DataTextField="bgm_option_name" DataValueField="bgm_option_seq"
                TriStateCheckBoxes="false" Height="450px"
                OnNodeCheck="tvOption_NodeCheck">
            </telerik:RadTreeView>
            </div>
            <div style="width:50%; float:left;">
                <asp:Panel ID="pnlSample" runat="server" Height="450px" ScrollBars="Auto">
                <asp:Repeater ID="rptSample" runat="server">
                    <ItemTemplate>
                        - <%# Container.DataItem %><br/>
                    </ItemTemplate>
                </asp:Repeater>
                </asp:Panel>
            </div>
            <table width="800px">
                <tr valign="top">
                    <td align="center" style="padding-top: 15px; border-top-style: double; border-top-width: 1px; border-top-color: #000000;">
                        <asp:Button ID="btnSaveAddNewOpt2" runat="server" Text="บันทึกข้อมูล" OnClick="btnSaveAddNewOpt2_Click" />
                    </td>
                </tr>
            </table> 
        </div>
    </form>
</body>
</html>
